import request from '../utils/request'

/**
 * 查询分类列表
 */
export function getCategoryList() {
  return request({
    url: '/category/list',
    method: 'get'
  })
}

/**
 * 创建分类
 */
export function createCategory(data) {
  return request({
    url: '/category',
    method: 'post',
    data
  })
}

/**
 * 更新分类
 */
export function updateCategory(categoryId, data) {
  return request({
    url: `/category/${categoryId}`,
    method: 'put',
    data
  })
}

/**
 * 删除分类
 */
export function deleteCategory(categoryId) {
  return request({
    url: `/category/${categoryId}`,
    method: 'delete'
  })
}
